package com.framework.bas.util.linq;

import java.util.Map;

import com.framework.bas.util.UtilReflect;

public class NullFilter implements IFilter {

	private String prop;

	public NullFilter(String prop) {
		this.prop = prop;
	}

	@SuppressWarnings("unchecked")
	public boolean filter(ILinq linq, Object e) {
		Object compare = null;
		if (e instanceof Map) {
			compare = ((Map) e).get(prop);
		} else {
			compare = UtilReflect.getReflectValue(e, prop);
		}
		if (compare == null) {
			return true;
		}
		return false;
	}

}
